<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getLocalPort()+request.getContextPath()+"/";
%>


<%@page import="java.util.Date"%><html>
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<c:set var="outstr" value="<b>中国人</b>" ></c:set>
java:<%=pageContext.getAttribute("outstr") %><br/>
cout:<c:out value="${outstr}" escapeXml="true"></c:out><br/>
el:${outstr}

<%/*
<jsp:useBean id="testBean" class="bean.TestBean">
</jsp:useBean>
<jsp:setProperty property="foo2" name="testBean" value="3"/>
<c:set target="${testBean}" property="foo1">hello</c:set>
<br/>
${testBean.foo1}
<br/>
${testBean.foo2}
*/%>
<!--输出结果：
java:中国人
cout:<b>中国人</b>
el:中国人
2015/10/19 17:17:21.390
15-10-19
3,434,123
03,434,123
￥3,434,123.00
a@sina.com 0
b@163.com 1 
 -->
<%pageContext.setAttribute("now",new Date()); %><br/>
<fmt:formatDate value="${now}" pattern="yyyy/MM/dd HH:mm:ss.SSS"/><br/>
<fmt:formatDate value="${now}" dateStyle="short" timeStyle="short"/><br/>
<fmt:formatNumber pattern="##,###" value="3434123"></fmt:formatNumber><br/>
<fmt:formatNumber pattern="00000,000" value="3434123"></fmt:formatNumber><br/>
<fmt:formatNumber type="currency" value="3434123"></fmt:formatNumber><br/>
<c:set var="emails" value='${fn:split("a@sina.com;b@163.com",";")}'></c:set> 
<c:forEach var="email" items="${emails}" varStatus="status">${email} ${status.index}<br/>
</c:forEach> 
</body>
</html>